<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\VideoType */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="video-type-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <div>
        <label>Pid</label>
        <select name="pid" class="form-control" aria-invalid="true" style="font-size: 18px;height:50px;">
            <option value="0">设置顶级分类</option>
            <?php if (isset($data)&& !empty($data)){?>
                <?php foreach ($data as $k => $v){ ?>
                    <option value="<?= $v['id']?>"> <?= $v['name']?> </option><br/><br/>
                <?php } ?>
            <?php }?>
        </select>
        <br/>
    </div>


    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
